package com.testpro.DesignPattern.FacadePattern;

public class MarriageBureau implements MarriageRegistration {
    private final Marry marry = new Marryimp();

    public void marrywithGirl(String name, int Money) {
        marry.Loveing(name);
        marry.SendMoney(Money);
        if (this.MarriageRegistr()) {
            marry.MarryUp();
        } else {
            System.out.println("不好意思 您不符合结婚登记的要求 建议您分手");
        }

    }

    @Override
    public boolean MarriageRegistr() {

        System.out.println("我们这里是婚姻登记中心 请出示您的证件");
        int randomNumber = (int) (Math.random() * 2)+1;
        if (randomNumber > 1) {
            return true;
        } else {
            return false;
        }
    }
}
